package com.ht.common.core.valid;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

/**
 * 自定义正则验证
 * @author Administrator
 *
 */
@Target({ ElementType.METHOD, ElementType.TYPE,ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = {SelfPatternValidator.class})
public @interface SelfPattern {
	 // 默认错误消息
    String message() default "参数格式不正确";
 
    // 分组
    Class<?>[] groups() default {};
 
    // 负载
    Class<? extends Payload>[] payload() default {};
    
    String regexp() default "";
    /**
     * 是否匹配空白,默认不匹配，就是默认必须匹配上给定的值范围
     * @return
     */
    boolean blankMatch() default false;

}
